package com.db.tenant.controller;


import com.db.core.vo.PageResult;

import com.db.core.vo.R;
import com.db.tenant.dto.TenantPageDto;
import com.db.tenant.service.TenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 作者：Bin
 * 时间：2023/10/29
 * 描述：键盘敲烂，薪资过万
 */
@RestController
@RequestMapping("tenant")
@CrossOrigin
public class TenantController {

    @Autowired
    private TenantService tenantService;

    @PostMapping("page")
    public PageResult pageList(@RequestBody() TenantPageDto tenantPageDto){
        return tenantService.pageList(tenantPageDto);
    }

    @GetMapping("toggleEnable/{tenantID}")
    public R toggleEnable(@PathVariable String tenantID){
        return tenantService.toggleEnable(tenantID);
    }
}
